package board.dao;

import java.sql.SQLException;
import java.util.ArrayList;
import java.util.HashMap;

import org.springframework.orm.ibatis.SqlMapClientTemplate;

import board.to.GeneratorTO;
import board.to.P1TO;


public class BoardDAO {
	private SqlMapClientTemplate sqlMap;

	public BoardDAO(SqlMapClientTemplate sqlMap) {
		super();
		this.sqlMap = sqlMap;
	}
	
	public Object insertGenerator(GeneratorTO gto)throws SQLException{
		return sqlMap.insert("insertGenerator",gto);
	}
	public GeneratorTO selectGenerator(int result) throws SQLException{
		return (GeneratorTO)sqlMap.queryForObject("selectGenerator", result);
	}
	public Object selectgtseq() throws SQLException{
		return (Integer)sqlMap.queryForObject("selectgtseq");
	}
	public Object selectp1Status() throws SQLException{
		return (Integer)sqlMap.queryForObject("selectp1Status");
	}
	public Object selectgtseqStop() throws SQLException{
		return (Integer)sqlMap.queryForObject("selectgtseqStop");
	}
	public Object selectP1seqStop() throws SQLException{
		return (Integer)sqlMap.queryForObject("selectP1seqStop");
	}
	public Object selectP1seq() throws SQLException{
		return (Integer)sqlMap.queryForObject("selectP1seq");
	}
	public Object selectP2seq() throws SQLException{
		return (Integer)sqlMap.queryForObject("selectP2seq");
	}
	public Object insertP1(P1TO p1to)throws SQLException{
		return sqlMap.insert("insertP1",p1to);
	}
	public P1TO selectP1(int result) throws SQLException{
		return (P1TO)sqlMap.queryForObject("selectP1", result);
	}
	public int deleteGenerator(int result) throws SQLException{
		return sqlMap.delete("deleteGenerator",result);
	}
	public int deleteP1(int result) throws SQLException{
		return sqlMap.delete("deleteP1",result);
	}
	public int updatep1Status0() throws SQLException{
		return sqlMap.update("updatep1Status0");
	}
	public int updatep1Status1() throws SQLException{
		return sqlMap.update("updatep1Status1");
	}
	public int updategtseq() throws SQLException{
		return sqlMap.update("updategtseq");
	}
	public int updategtseqStopYes() throws SQLException{
		return sqlMap.update("updategtseqStopYes");
	}
	public int updategtseqStopNo() throws SQLException{
		return sqlMap.update("updategtseqStopNo");
	}
	public int updateP1seqStopYes() throws SQLException{
		return sqlMap.update("updatep1seqStopYes");
	}
	public int updateP1seqStopNo() throws SQLException{
		return sqlMap.update("updatep1seqStopNo");
	}
	public int updategtseqStop() throws SQLException{
		return sqlMap.update("updategtseqStop");
	}
	public int updateP1seq() throws SQLException{
		return sqlMap.update("updateP1seq");
	}
	public int updateP1seqStop() throws SQLException{
		return sqlMap.update("updateP1seqStop");
	}
	public int updateP2seq() throws SQLException{
		return sqlMap.update("updateP2seq");
	}
}
